-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Shuffle(). #85129
Adding Shuffle(). #85129
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThis PR adds
@dotnet/avx512-contrib
|
Can you open an issue for this? |
I could either do that or fix it. Basically, this assert doesn't make sense and the way we copy vector probably needs a slight change I believe I just need to change it to I'm okay with either solution. Just wanted to make sure I did not misunderstand before changing the assert Edit : pointing to correct line |
Just iterating what we chatted about on Teams. We'll want to fix it here, but if you could open an issue for it as well that'd be great, as I need to look at backporting the fix for .NET 7 Thankfully its a small fix (basically 1-line change + tweaking the assert slightly). |
I'll add a fix here to this PR. For backporting - #85132 |
8230053
to
f05affc
Compare
a8618c2
to
ac63e4a
Compare
Do we need new tests to go along with this? @tannergooding It looks like we're missing tests for lots of the AVX512 intrinsics? |
This table doesn't have an entry for Shuffle. Am I missing something? |
They are mostly on the library side due to complexity in the cross platform implementation: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector512Tests.cs#L2263-L3370 The platform specific shuffle APIs (which use the same general instructions) are a bit less complex and are table generated: |
@@ -23176,7 +23176,7 @@ GenTree* Compiler::gtNewSimdShuffleNode( | |||
#if defined(TARGET_XARCH) | |||
uint8_t control = 0; | |||
bool crossLane = false; | |||
bool needsZero = varTypeIsSmallInt(simdBaseType); | |||
bool needsZero = varTypeIsSmallInt(simdBaseType) && (simdSize != 64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct for the PR, but just noting we'll want to update the other simdSizes
to use the full-width permutations as well, long term.
This PR adds
Vector512.Shuffle()
.Vector256.Shuffle()
has a bug when index is out of range. I didn't change it for now. I worked around it forVector512
Vector512.IsHardwareAccelerated
already returns 1@dotnet/avx512-contrib